<?php

//都邦
use IDock\IDock\IDock;
use IDock\Insurance\DBIC\DBICConstruct;
use IDock\Printer\EPolicyDownloadPrinter;
use IDock\Printer\PolicyPaymentPrinter;
use IDock\Printer\Premium\PremiumInquiryPrinter;
use IDock\Printer\PremiumUnderwritingPrinter;
use IDock\Printer\ProposalRecallPrinter;
use IDock\Printer\ProposalStatusPrinter;
use IDock\Printer\UploadFilePrinter;
use IDock\Printer\VehicleModelPrinter;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarProductListVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumCarTaxVisitor;
use IDock\Visitor\Premium\PremiumChargingPileVisitor;
use IDock\Visitor\Premium\PremiumCoverageVisitor;
use IDock\Visitor\Premium\PremiumExtInfoVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\Premium\PremiumRelationVisitor;
use IDock\Visitor\Premium\PremiumUnderwritingVisitor;
use IDock\Visitor\Premium\PremiumVehicleVisitor;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\SpecialClausesVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleActualValueVisitor;
use IDock\Visitor\VehicleModelVisitor;

require_once('./vendor/autoload.php');

$IDock = new IDock();
$shortName = 'DBIC';

$DBICConfig = [
    'gateway' => '......',
    'usercode' => '......',
    'password' => '......',
    'key' => '......',
    'module16' => '......',
    'empoent16' => '......',
    'logsDir' => './DBICLogs',
    'timeout' => '10',
    'proxy' => '......',
];

require_once('config.php');

$IDock->setBean($shortName, $DBICConfig);

global $testResponse;

$vin = 'LSV2B6CA3JN531723';
$engineNo = '620984';
$licenseNo = '川A44DD8';
$firstRegisterDate = '2018-12-10';
$vehicleModel = '大众汽车牌SVW6505FFD';

$biStartData = '2023-12-10 00:00:00';
$ciStartData = '2023-12-10 00:00:00';
$biEndData = '2024-12-09 23:59:59';
$ciEndData = '2024-12-09 23:59:59';

/*** @var $insurance DBICConstruct */
$insurance = $IDock->getBean($shortName);

//RSA 获取
if (0) {
    //$testResponse = '{"responseCode":"0","responseMsg":"失败","errorCode":"2010","errorMsg":"sign check failed","responseTime":"2023-11-01 11:30:49","processId":"7792ba3e78f044ad","result":{"data":{"records":[{"info":"报文验签失败，请联系管理员！"}]}}}';
    //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-01 15:55:54","processId":"351afde0df6ece14","result":{"data":{"records":[{"module16":"9d259468e52708a2dc8dc07073f41536af89580758f0a78954b0002a0a47bf95085cdd69ab1517d92ca3e91f50ef3699c6c93693d03f1a1d9ff67d188ae82495bc375b4927e640d85a0d0e8a6cb743fd228d475304f8bc83c084a64281ef2c3b9d2fae7271c27ba50f4f461d63b4894654930ebdb1cd226b5914d534ad10a265","empoent16":"10001"}]}}}';
    $response = $insurance->rsaPublicKey();
    var_dump($response->isSuccess());
    var_dump($response->getError());
    var_dump($response->getModule16());
    var_dump($response->getExponent16());
    exit();
}

//token 获取
if (0) {
    //$testResponse = '{"responseCode":"0","responseMsg":"失败","errorCode":"3011","errorMsg":"密码输入错误次数已达1次，还剩4次机会！","responseTime":"2023-11-02 11:17:27","processId":"5c2ac8eaa9aa1edb","result":{"data":{"records":[{"info":"authentication failed, reason: Bad credentials"}]}}}';
    //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"成功","responseTime":"2023-11-14 09:29:57","token":"eyJhbGciOiJIUzUxMiJ9.eyJpcCI6Im51bGwiLCJ1dWlkIjoiNDQ4YTBlNzQ0NDBlNDc4OGE0ZGY5OGQ1NjU5MjNiMTMiLCJhdWQiOiJodHRwOi8vd3d3LmRmaHRrZy5jb20uY24iLCJpc3MiOiJodHRwOi8vd3d3LmRiaWMuY29tLmNuIiwic3ViIjoiSTAwMDAwMDAwMSIsImlhdCI6MTY5OTkyNTM5NywiZXhwIjoxNjk5OTg4NDAwfQ.HUUyzz5AQ_eanoDlHuliTHgyRAUIcdPQ7pvtVyXs9LrISJFZCCWsxpamYgpwptpqRWxTXUR35maR7xgWt84ymg","tokenExpire":"2023-11-15 03:00:00","processId":"04ceb99451650cd9","result":{"data":{"records":[{"info":"login success","userName":"衡信业四川成都代理账号","key":"PYJ2PCK0F1RXA7O2P9XUNKZS5FNFVFZY","userInfo":{"agreeStartDate":"","agreeEndDate":"","dependsComcode":"2610400601","dependsOperator":"261041034","dependsHandlerCode":"261041034","businessChannel":"1","businessNature":"10","topCommisionBi":"0","topCommissionCi":"0"},"userCode":"I000000001","userSex":"1","currentLoginInfo":{"loginTime":"2023-11-14 09:29:57"},"lastLoginInfo":{"loginTime":"2023-11-13 09:21:25","loginCityName":"null"}}]}}}';
    $response = $insurance->loginToken();
    var_dump($response->isSuccess());
    var_dump($response->getError());
    var_dump($response->getToken());
    var_dump($response->getTokenExpire());

    $expireData = $response->getTokenExpire();

    var_dump(strtotime($expireData)-time());

    exit;
}

$token = 'eyJhbGciOiJIUzUxMiJ9.eyJpcCI6Im51bGwiLCJ1dWlkIjoiODQ4MjJiNzAxOTgxNGI4ZDhiNzliOTc4ZTgzZTEwOWYiLCJhdWQiOiJodHRwOi8vd3d3LmRmaHRrZy5jb20uY24iLCJpc3MiOiJodHRwOi8vd3d3LmRiaWMuY29tLmNuIiwic3ViIjoiSTAwMDAwMDAwMSIsImlhdCI6MTcwNjUxMDI3MCwiZXhwIjoxNzA2NTU0ODAwfQ.1rrOk2TPCqfF3GvzE68k_EuKcse7_DuUXX5av0CHVM-BEIj4GleXqNvqY_7SFf2PLLcYVOjidzIWg1ygHA8ToA';
$insurance->setToken($token);

//可投险别初始化接口
if (0) {
    //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-03 17:24:50","processId":"f41f552e8059a37a","result":{"data":{"records":[{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"A","kindname":"机动车损失保险","iskindmain":"1","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"Y11N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"B","kindname":"机动车第三者责任保险","iskindmain":"1","isnondeductible":"2","attkindcode":"B","handinput":"1","calculateflag":"Y21N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"B2","kindname":"附加法定节假日限额翻倍险","iskindmain":"2","isnondeductible":"2","attkindcode":"B","handinput":"1","calculateflag":"Y22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"D2","kindname":"附加车上货物责任险","iskindmain":"2","isnondeductible":"2","attkindcode":"B","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"D3","kindname":"机动车车上人员责任保险（司机）","iskindmain":"1","isnondeductible":"2","attkindcode":"D3","handinput":"1","calculateflag":"Y21N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"D4","kindname":"机动车车上人员责任保险（乘客）","iskindmain":"1","isnondeductible":"2","attkindcode":"D4","handinput":"1","calculateflag":"Y21N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H3_B","kindname":"附加医保外用药责任险（机动车第三者责任保险）","iskindmain":"2","isnondeductible":"2","attkindcode":"B","handinput":"1","calculateflag":"Y12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H3_D3","kindname":"附加医保外用药责任险（机动车车上人员责任保险（司机））","iskindmain":"2","isnondeductible":"2","attkindcode":"D3","handinput":"1","calculateflag":"Y12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H3_D4","kindname":"附加医保外用药责任险（机动车车上人员责任保险（乘客））","iskindmain":"2","isnondeductible":"2","attkindcode":"D4","handinput":"1","calculateflag":"Y12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H4_01","kindname":"道路救援服务特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"A,B,D3,D4","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H4_02","kindname":"车辆安全检测特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"A,B,D3,D4","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H4_03","kindname":"代为驾驶服务特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"A,B,D3,D4","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"H4_04","kindname":"代为送检服务特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"A,B,D3,D4","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"K","kindname":"事故免赔率特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"K","handinput":"1","calculateflag":"N12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"L","kindname":"附加车身划痕损失险","iskindmain":"2","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"N12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"R_B","kindname":"附加精神损害抚慰金责任险（机动车第三者责任保险）","iskindmain":"2","isnondeductible":"2","attkindcode":"B","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"R_D3","kindname":"附加精神损害抚慰金责任险（机动车车上人员责任保险（司机））","iskindmain":"2","isnondeductible":"2","attkindcode":"D3","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"R_D4","kindname":"附加精神损害抚慰金责任险（机动车车上人员责任保险（乘客））","iskindmain":"2","isnondeductible":"2","attkindcode":"D4","handinput":"1","calculateflag":"N22N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"T","kindname":"附加修理期间费用补偿险","iskindmain":"2","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"N12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"X","kindname":"附加新增加设备损失险","iskindmain":"2","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"N12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"X2","kindname":"附加车轮单独损失险","iskindmain":"2","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"N12N00","validstatus":"1"},{"clausetype":"01","producttype":"0101","riskcode":"0510","kindcode":"X3","kindname":"附加发动机进水损坏除外特约条款","iskindmain":"2","isnondeductible":"2","attkindcode":"A","handinput":"1","calculateflag":"N12N00","validstatus":"1"}]}}}';
    $response = $insurance->productClause();
    var_dump($response->isSuccess());
    var_dump($response->getError());
    var_dump($response->getCoverageList());
    exit();
}

//车型获取
if (0) {
    $testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2024-01-10 11:59:18","processId":"19fc78693de32b82","result":{"data":{"records":[{"modelCode":"JPAAAI0022","modelName":"大切诺基GRAND CHEROKEE 3.6L越野车","hfCode":"0","hfName":"正常缴税","platModelCode":"BJPDDRUG0002","carYear":"201106","seatCount":"5","exaustScale":"3.604","countryCode":"2","purchasePrice":"659900","purchasePriceTax":"716302","completekerbMass":"2.2790","modelDesc":"手自一体 70周年限量版","powerTypeCode":"0","carBrand":"吉普","queryByVin":"1"},{"modelCode":"JPAAAI0024","modelName":"大切诺基GRAND CHEROKEE 3.6L越野车","hfCode":"0","hfName":"正常缴税","platModelCode":"BJPDDRUF0001","carYear":"201111","seatCount":"5","exaustScale":"3.604","countryCode":"2","purchasePrice":"564900","purchasePriceTax":"613182","completekerbMass":"2.2350","modelDesc":"手自一体 周年纪念导航版舒适型","powerTypeCode":"0","carBrand":"吉普","queryByVin":"1"},{"modelCode":"JPAAAI0025","modelName":"大切诺基GRAND CHEROKEE 3.6L越野车","hfCode":"0","hfName":"正常缴税","platModelCode":"BJPDDRUF0002","carYear":"201111","seatCount":"5","exaustScale":"3.604","countryCode":"2","purchasePrice":"614900","purchasePriceTax":"667456","completekerbMass":"2.2350","modelDesc":"手自一体 周年纪念导航版豪华型","powerTypeCode":"0","carBrand":"吉普","queryByVin":"1"},{"modelCode":"JPAAAI0076","modelName":"大切诺基GRAND CHEROKEE 3.6L越野车","hfCode":"0","hfName":"正常缴税","platModelCode":"BJPDDRUB0004","seatCount":"5","exaustScale":"3.604","countryCode":"2","purchasePrice":"400000","purchasePriceTax":"434188","modelDesc":"手自一体 中东版","powerTypeCode":"0","carBrand":"吉普","queryByVin":"1"}]}}}';

    $vehicleModelVisitor = new VehicleModelVisitor();
    //车架号
    $vehicleModelVisitor->vin = $vin;
    //发动机号
    $vehicleModelVisitor->engineNo = $engineNo;
    //车牌号
    $vehicleModelVisitor->licenseNo = $licenseNo;
    //初登时间
    $vehicleModelVisitor->firstRegisterDate = $firstRegisterDate;
    //车型编码
    $vehicleModelVisitor->vehicleModel = $vehicleModel;

    $response = $IDock->vehicleModel($shortName, $vehicleModelVisitor);

    var_dump($response->isSuccess());
    var_dump($response->getError());

    /*** @var $printer VehicleModelPrinter */
    $printer = $response->getPrinter();
    var_dump($printer->toArray());
    exit;
}

//车辆实际价格
if (0) {
    //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-14 10:36:29","processId":"2752b7fd190888fc","result":{"data":{"records":[{"modelCode":"DZABND0019","modelName":"大众汽车SVW6505FFD多用途乘用车","hfCode":"0","hfName":"正常缴税","platModelCode":"BSHCTAUC0002","carYear":"201811","seatCount":"7","exaustScale":"1.984","countryCode":"1","purchasePrice":"293900","purchasePriceTax":"319020","completekerbMass":"2.0250","modelDesc":"双离合 舒适版 四驱 国Ⅴ","powerTypeCode":"0","carBrand":"上汽大众","queryByVin":"1"},{"modelCode":"DZABND0020","modelName":"大众汽车SVW6505FFD多用途乘用车","hfCode":"0","hfName":"正常缴税","platModelCode":"BSHCTAUD0003","carYear":"201811","seatCount":"7","exaustScale":"1.984","countryCode":"1","purchasePrice":"333900","purchasePriceTax":"362438","completekerbMass":"2.0250","modelDesc":"双离合 豪华版 四驱 国Ⅴ","powerTypeCode":"0","carBrand":"上汽大众","queryByVin":"1"},{"modelCode":"DZABND0021","modelName":"大众汽车SVW6505FFD多用途乘用车","hfCode":"0","hfName":"正常缴税","platModelCode":"BSHCTAUD0004","carYear":"201811","seatCount":"7","exaustScale":"1.984","countryCode":"1","purchasePrice":"393900","purchasePriceTax":"427567","completekerbMass":"2.0250","modelDesc":"双离合 旗舰版 四驱 国Ⅴ","powerTypeCode":"0","carBrand":"上汽大众","queryByVin":"1"}]}}}';
    $vehicleActualValueVisitor = new VehicleActualValueVisitor();
    $vehicleActualValueVisitor->startDate = $biStartData;
    $vehicleActualValueVisitor->firstRegisterDate = $firstRegisterDate;
    //车辆价格
    $vehicleActualValueVisitor->vehiclePrice = '319020';
    //能源类型
    $vehicleActualValueVisitor->energyType = 'E01';
    //是否新能源
    $vehicleActualValueVisitor->isNewEnergy = false;
    //使用性质
    $vehicleActualValueVisitor->useNatureCode = '01';
    //车辆用途
    $vehicleActualValueVisitor->causeType = '001';
    //车辆种类
    $vehicleActualValueVisitor->carKindCode = '100';
    //座位数
    $vehicleActualValueVisitor->vehicleSeat = '5';
    //荷载质量
    $vehicleActualValueVisitor->vehicleTonnage = '0';

    $response = $IDock->vehicleActualValue($shortName, $vehicleActualValueVisitor);
    var_dump($response->isSuccess());
    var_dump($response->getError());

    /*** @var $printer \IDock\Printer\VehicleActualValuePrinter */
    if ($printer = $response->getPrinter()) {
        var_dump($printer->toArray());

    }
    exit;
}

$vehiclePrice = '204172.80';

//报价
if (1) {
    /**
     * 询价主信息
     */
    $premiumInquiryVisitor = new PremiumInquiryVisitor();
    //商业险起保日期
    $premiumInquiryVisitor->biStartData = $biStartData;
    //商业险终保日期
    $premiumInquiryVisitor->biEndData = $biEndData;
    //交强险起保日期
    $premiumInquiryVisitor->ciStartData = $ciStartData;
    //交强险终保日期
    $premiumInquiryVisitor->ciEndData = $ciEndData;
    //商业险即时生效
    $premiumInquiryVisitor->biEffectFlag = false;
    //交强险即时生效
    $premiumInquiryVisitor->ciEffectFlag = false;

    $premiumInquiryVisitor->isNewEnergy = false;

    /**
     * 车辆信息
     */
    $premiumVehicleVisitor = new PremiumVehicleVisitor();
    //是否新车
    $premiumVehicleVisitor->isNewVehicle = '0';
    //车架号
    $premiumVehicleVisitor->vin = $vin;
    //发动机号
    $premiumVehicleVisitor->engineNo = $engineNo;
    //车牌号
    $premiumVehicleVisitor->licenseNo = $licenseNo;
    //初登时间
    $premiumVehicleVisitor->firstRegisterDate = $firstRegisterDate;
    //过户时间
    $premiumVehicleVisitor->transferDate = '';
    //是否过户车
    $premiumVehicleVisitor->isTransfer = '';
    //发证时间
    $premiumVehicleVisitor->issueDate = '';
    //车型编码
    $premiumVehicleVisitor->vehicleModel = $vehicleModel;
    //车型编码代码
    $premiumVehicleVisitor->vehicleModelCode = 'DZABND0019';
    $premiumVehicleVisitor->argc['platModelCode'] = 'BSHCTAUC0002';

    //车型名称
    $premiumVehicleVisitor->vehicleName = '大众汽车SVW6505FFD多用途乘用车';
    //车价
    $premiumVehicleVisitor->vehiclePrice = '293900';
    //车价含税
    $premiumVehicleVisitor->vehiclePriceTax = '319020';
    //协商价格
    $premiumVehicleVisitor->actualValue = $vehiclePrice;
    //座位数
    $premiumVehicleVisitor->vehicleSeat = '5';
    //使用性质
    $premiumVehicleVisitor->useNatureCode = '01';
    //所属性质
    $premiumVehicleVisitor->attachNature = '01';
    //车辆用途
    $premiumVehicleVisitor->causeType = '001';
    //车辆种类
    $premiumVehicleVisitor->carKindCode = '100';
    //能源类型代码
    $premiumVehicleVisitor->energyTypeCode = 'E01';
    //号牌颜色代码
    $premiumVehicleVisitor->licenseColorCode = '01';
    //号牌种类代码
    $premiumVehicleVisitor->licenseTypeCode = '02';
    //交管车辆类型代码
    $premiumVehicleVisitor->vehicleStyleCode = 'K33';
    //功率
    $premiumVehicleVisitor->power = '';
    //排量
    $premiumVehicleVisitor->vehicleExhaust = '1.984';
    //整备质量
    $premiumVehicleVisitor->wholeWeight = '2025';
    //荷载质量
    $premiumVehicleVisitor->vehicleTonnage = '0.0';
    //进口标识
    $premiumVehicleVisitor->vehicleImport = 'I3';
    //是否能源车
    $premiumVehicleVisitor->isNewEnergy = '1';
    //纯电续航里程(公里)
    $premiumVehicleVisitor->pureRange = '';
    //车辆来历凭证编号
    $premiumVehicleVisitor->carCertificateNo = '';
    //开具车辆来历凭证所载日期
    $premiumVehicleVisitor->carCertificateDate = '';
    //车辆来历凭证种类代码
    $premiumVehicleVisitor->carCertificateType = '';

    /**
     * 关系人
     */
    $premiumRelationVisitor = new PremiumRelationVisitor();
    //姓名
    $premiumRelationVisitor->name = '刘松';
    //联系方式
    $premiumRelationVisitor->mobile = '18215626530';
    //类型
    $premiumRelationVisitor->typeCode = 'R1';
    //证件类型
    $premiumRelationVisitor->certificateTypeCode = '01';
    //证件号码
    $premiumRelationVisitor->certificateNo = '510124199203020819';
    //地址
    $premiumRelationVisitor->address = '四川省成都市龙泉驿区龙泉车城西一路185号1栋1单元20楼2001号';
    //邮箱
    $premiumRelationVisitor->email = '18982272991@qq.com';
    //证件有效期
    $premiumRelationVisitor->certificateStartDate = '2000-01-01';
    //证件失效期
    $premiumRelationVisitor->certificateEndDate = '2050-01-01';

    /**
     * 缴税信息
     */
    $premiumCarTaxVisitor = new PremiumCarTaxVisitor();
    //缴税内心
    $premiumCarTaxVisitor->taxTypeCode = 'T01';
    //纳税人姓名
    $premiumCarTaxVisitor->taxpayerName = '刘松';
    //纳税人证件类型
    $premiumCarTaxVisitor->taxpayerCertificateTypeCode = '01';
    //纳税人证件号码
    $premiumCarTaxVisitor->taxpayerCertificateNo = '510124199203020819';
    //纳税人电话
    $premiumCarTaxVisitor->taxpayerPhone = '18215626530';
    //纳税起期
    $premiumCarTaxVisitor->taxStartDate = '';
    //纳税止期
    $premiumCarTaxVisitor->taxEndDate = '';
    //减免税方案代码
    $premiumCarTaxVisitor->taxReductionCode = '';
    //减免税原因代码
    $premiumCarTaxVisitor->taxReductionReasonCode = '';
    //税务机关名称
    $premiumCarTaxVisitor->taxDepartment = '';
    //税务机关代码
    $premiumCarTaxVisitor->taxDepartmentCode = '';
    //开具完税凭证地区代码
    $premiumCarTaxVisitor->taxPaidAreaCode = '';
    //完税凭证填发日期
    $premiumCarTaxVisitor->taxDocumentDate = '';
    //减免比例 百分比
    $premiumCarTaxVisitor->taxFreeRate = '';
    //减税金额 元
    $premiumCarTaxVisitor->taxExemption = '';
    //减免完税凭证号
    $premiumCarTaxVisitor->taxDocumentNumber = '';

    //险种
    $premiumCoverageVisitor = new PremiumCoverageVisitor();
    $premiumCoverageVisitor->coverageCode = 'C04001';
    $premiumCoverageVisitor->amount = '10000';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor);

    //
    $premiumCoverageVisitor1 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor1->coverageCode = 'C05001';
    $premiumCoverageVisitor1->amount = '40000';
    $premiumCoverageVisitor1->unitAmount = '10000';
    $premiumCoverageVisitor1->quantity = '4';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor1);

    //
    $premiumCoverageVisitor2 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor2->coverageCode = 'C03001';
    $premiumCoverageVisitor2->amount = '1000000';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor2);

    $premiumCoverageVisitor3 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor3->coverageCode = 'C02001';
    $premiumCoverageVisitor3->amount = $vehiclePrice;
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor3);

    //险种添加


    //新能源充电桩信息
    $premiumChargingPileVisitor = new PremiumChargingPileVisitor();
    //
    //$premiumChargingPileVisitor->seqNo = '1';
    ////充电桩类型
    //$premiumChargingPileVisitor->chargingPileKind = 'PK1';
    ////充电桩安装地点类型
    //$premiumChargingPileVisitor->chargingPileAddressType = 'PA1';
    ////充电桩使用年限
    //$premiumChargingPileVisitor->chargingPileYearLimit = 'PY1';
    ////充电桩编码
    //$premiumChargingPileVisitor->chargingPileCode = '123456';
    ////充电桩型号
    //$premiumChargingPileVisitor->chargingPileType = 'BCS100500';
    ////充电桩地址
    //$premiumChargingPileVisitor->chargingPileAddress = '地面充电桩';
    ////损失保险保额
    //$premiumChargingPileVisitor->lossAmount = '';
    ////责任保险保额
    //$premiumChargingPileVisitor->liabilityAmount = '10000';

    /**
     * 拓展信息
     */
    $premiumExtInfoVisitor = new PremiumExtInfoVisitor();
    //验车情况
    $premiumExtInfoVisitor->carCheckCode = '';
    //免验原因
    $premiumExtInfoVisitor->carCheckReasonKind = '';
    //验车人
    $premiumExtInfoVisitor->carChecker = '';
    //验车日期
    $premiumExtInfoVisitor->carCheckDate = '';
    //验车地点
    $premiumExtInfoVisitor->carAddress = '';
    //是否送修
    $premiumExtInfoVisitor->isMonopoly = '';
    //送修代码
    $premiumExtInfoVisitor->repairCode = '';
    //送修名称
    $premiumExtInfoVisitor->repairName = '';
    //自主定价系数
    $premiumExtInfoVisitor->selfPricingFactor = '';
    //自主核保系数
    $premiumExtInfoVisitor->underwritingFactor = '';
    //期望折扣
    $premiumExtInfoVisitor->expectedDiscount = '';
    //是否贷款车
    $premiumExtInfoVisitor->isLoanCar = '';
    //贷款机构名称
    $premiumExtInfoVisitor->loanOrg = '';


    //都邦拓展
    $premiumExtInfoVisitor->argc['agentCode'] = '';
    $premiumExtInfoVisitor->argc['agreementNo'] = '';
    $premiumExtInfoVisitor->argc['comCode'] = '2510100605';
    $premiumExtInfoVisitor->argc['inputSysCode'] = 'B2';
    $premiumExtInfoVisitor->argc['operatorCode'] = '251011069';
    $premiumExtInfoVisitor->argc['handler1Code'] = '251011069';
    $premiumExtInfoVisitor->argc['belongComCode'] = 'I00000000000';
    $premiumExtInfoVisitor->argc['belongUserCode'] = 'I000000001';

    //添加车辆信息
    $premiumInquiryVisitor->setVehicleVisitor($premiumVehicleVisitor);
    //添加投保人
    $premiumInquiryVisitor->setApplicantVisitor($premiumRelationVisitor);
    //添加被保人
    $premiumInquiryVisitor->setInsuredVisitor($premiumRelationVisitor);
    //添加车主
    $premiumInquiryVisitor->setOwnerVisitor($premiumRelationVisitor);
    //车船税
    $premiumInquiryVisitor->setCarTaxVisitor($premiumCarTaxVisitor);

    //新能源充电桩
    $premiumInquiryVisitor->chargingPileVisitorAppend($premiumChargingPileVisitor);
    //拓展信息
    $premiumInquiryVisitor->setExtInfoVisitor($premiumExtInfoVisitor);

    //非车
    $nonCarInquiryVisitor = new  NonCarInquiryVisitor();
    $nonCarInquiryVisitor->endData = '';
    $nonCarInquiryVisitor->startData = '';
    $nonCarProduct = new \IDock\Visitor\NonCar\NonCarProductVisitor();
    $nonCarProduct->insuredNum = 1;
    $nonCarProduct->premium = 100;
    $nonCarInquiryVisitor->nonCarListAppend($nonCarProduct);
    $premiumInquiryVisitor->setNonCarInquiryVisitor($nonCarInquiryVisitor);

    //询价
    if (1) {
//        $testResponse = '';
        //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-20 10:22:42","processId":"5a09bd3fa0a37060","result":{"data":{"records":[{"calculateNo":"Q0515251010023000051","premiumBi":{"quoteorderserialno":"Q0515251010023000051","claimAdjustValue":"1.0","discount":"1.2736","peccancyAdjustValue":"1.0","shortRate":"100.0000","sumAmount":"2100227.95","sumBenchmarkPremium":"2627.23","sumDisountPremium":"-718.81","sumPremium":"3346.04","sumsubpremium":"0.00","ilogfeetypebi":"Y1","ilogbusinesstypebi":"999","deductionpremium":"0.00","insureYears":"0","claimTimes":"0","claimAdjustLevel":"0"},"premiumCi":{"quoteorderserialno":"Q0515251010023000051","basedPremium":"950.0","claimAdjustValue":"1.0","discount":"1.00","peccancyAdjustValue":"1.0","rateFloatFlag":"02","reinsureFlag":"0","shortRate":"100.0000","standardPremium":"950.0","sumAmount":"200000.00","sumDisountPremium":"0.00","sumsubpremium":"0.00","ilogfeetypeci":"Y1","ilogbusinesstypeci":"999"},"carShipTax":{"quoteorderserialno":"Q0515251010023000051","annualTaxDue":"0.0","sumOverrdue":"0.0","sumTax":"0.0","sumTaxDefault":"0.0","taxDocumentNumber":"251888电动车","taxEndDate":"20231231","taxPayerIdentificationCode":"510124199203020819","taxPayerName":"刘松","taxRegistryNumber":"510105795848194","taxRelifFlag":"N","taxStartDate":"20230101","unitRate":"0.0"},"premiumKinds":[{"quoteorderserialno":"Q0515251010023000051","basePremium":"1463.78","benchMarkPremium":"1722.09","itemkindNo":"1","kindCode":"A","premium":"2193.25","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0","amount":"60227.95"},{"quoteorderserialno":"Q0515251010023000051","basePremium":"707.77","benchMarkPremium":"832.67","itemkindNo":"2","kindCode":"B","premium":"1060.49","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251010023000051","basePremium":"21.22","benchMarkPremium":"24.96","itemkindNo":"3","kindCode":"D3","premium":"31.80","rate":"0.2122","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251010023000051","basePremium":"40.38","benchMarkPremium":"47.51","itemkindNo":"4","kindCode":"D4","premium":"60.50","rate":"0.1346","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"}],"biQueryInfo":{"querySequenceNo":"V0101DBIC510023110990446653434","queryPastDate":"202311301017","renewalFlag":"0","newVehicleFlag":"0","isRedis":"1"},"ciQueryInfo":{"querySequenceNo":"01DBIC510023110280446653612325","renewalFlag":"0","isNewCarFlag":"0","isRedis":"1"},"nonVehicleSubSidy":{"nonVehicleSubsidy":"0.0","nonVehicleSubsidyFlag":"1","billCORilog":"0.9","billCORilogFlag":"1","businesstype":"null","strategyAdj":"1"},"main":{"priceId":"18202311201022071096411520","requestId":"Q0515251010023000051","certiNo":"18202311201022071096411520","tradeType":"T","isPrice":"1","commissionFlag":"COMMISSIONFLAG","uwPolicyType":"2","uwdiscfixed":"0.0","uwDiscLimit":"0.0","uwDiscFloor":"1.0","comCostPrem":"2400.86","ctpCostPrem":"1035.67","ctpCostPremFlag":"2","entireRecommenDiscount":"1.2736","entireUwritingDiscount":"1.2736","entireRawInitialDiscount":"1.2736","entireInitialDiscount":"1.2736","entireExpDiscount":"0.0","entireFloatDiscount":"0.0","entireDiscount":"1.2736","billComCommission":"0.0","billComCor":"0.7606","billCtpCor":"1.2006","billCommission":"0.01","billCor":"0.8579","billCtpelr":"1.1556","billComelr":"0.7606","billElr":"0.8479","sunlightScore":"61.0","comSunlightScore":"0.0","ctpSunlightScore":"0.0","strategyAdj":"1.0","entireFitDiscAdj":"1.2736","entireFitDiscAdj2":"1.2736","entireControlIntialDiscount":"1.2736","recommenELR":"0.8479","initialELR":"0.8479","billCTPELR2":"1.1556","billCOMELR2":"0.7606","billELR2":"0.8479","ncdbpremELR":"1.0183"},"underWritingFactors":[{"factorCode":"C20","factorFlag":"2","factorName":"无赔款优待系数","factorValue":"1.0"},{"factorCode":"C17","factorFlag":"2","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"2","factorName":"自主定价系数","factorValue":"1.2736"}],"initialFactors":[{"factorCode":"C20","factorFlag":"3","factorName":"无赔款优待系数","factorValue":"1.0"},{"factorCode":"C17","factorFlag":"3","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"3","factorName":"自主定价系数","factorValue":"1.2736"}],"signBillFactors":[{"factorCode":"C20","factorFlag":"6","factorName":"无赔款优待系数","factorValue":"1.0"},{"factorCode":"C17","factorFlag":"6","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"6","factorName":"自主定价系数","factorValue":"1.2736"},{"factorCode":"C01","factorFlag":"6","factorName":"指定驾驶人","factorValue":"1.0"},{"factorCode":"C24","factorFlag":"6","factorName":"平均年行驶里程","factorValue":"1.0"},{"factorCode":"C23","factorFlag":"6","factorName":"多险别投保","factorValue":"0.95"},{"factorCode":"C33","factorFlag":"6","factorName":"客户风险等级","factorValue":"1.2768"},{"factorCode":"C04","factorFlag":"6","factorName":"行驶区域","factorValue":"1.05"}],"rules":[{"ruleCode":"新-004","ruleType":"2"}],"carModels":[{"modelCode":"BJHAIAUB0001","modelIDCode":"BJHAIAUB000170A1","tradeName":"安徽江淮汽车股份有限公司","tradeCode":"M0007","brand":"江淮","brandCode":"JHA","series":"江淮iEV6E","seriesCode":"JHAIA","carName":"江淮HFC7000WEV","noticeType":"HFC7000WEV","configType":"UB","categoryName":"轿车","categoryCode":"7","deptName":"国产","deptCode":"0"}],"modelPrices":[{"modelCode":"BJHAIAUB0001","noticeType":"HFC7000WEV"}],"LastPolicy":{},"biPlatQuery":{"outHead":{"requestType":"173","responseCode":"1","errorCode":"000000","errorMessage":"成功","logId":"109640993"},"body":{"basePartOutDto":{"querySequenceNo":"V0101DBIC510023110990446653434","queryPastDate":"202311301017","renewalFlag":"0","newVehicleFlag":"0","isRedis":"1"},"lastPolicyOutDto":{},"carModelOutDtos":[{"modelCode":"BJHAIAUB0001","modelIDCode":"BJHAIAUB000170A1","tradeName":"安徽江淮汽车股份有限公司","tradeCode":"M0007","brand":"江淮","brandCode":"JHA","series":"江淮iEV6E","seriesCode":"JHAIA","carName":"江淮HFC7000WEV","noticeType":"HFC7000WEV","configType":"UB","categoryName":"轿车","categoryCode":"7","deptName":"国产","deptCode":"0"}],"riskItemOutDto":{"claimAdjustValue":"0.0","noClaimAdjustReason":"04","peccancyAdjustValue":"0.0","insureYears":"0","claimTimes":"0","claimAdjustLevel":"0"},"coveragePremiumItemOutDto":{"coverageCode":"0401200","pureRiskPremiumItemOutDtos":[{"modelCode":"BJHAIAUB0001","pureRiskPremium":"1463.776500","pureRiskPremiumFlag":"1"}]}}},"ciPlatQuery":{"outHead":{"requestType":"013","responseCode":"1","errorCode":"000000","errorMessage":"成功","logId":"109641000"},"ciPlatQueryOutBody":{"basePart":{"querySequenceNo":"01DBIC510023110280446653612325","renewalFlag":"0","isNewCarFlag":"0","isRedis":"1"},"coverages":[{"coverageType":"1","coverageCode":"BZ","standardPremium":"950.0","peccancyAdjustValue":"0.0","claimAdjustValue":"0.0","basedPremium":"950.0","reteFloatFlag":"02","reinsureFlag":"0"}],"carshipTax":{"taxTermTypeCode":"08","taxConditionCode":"N","taxRegistryNumber":"510105795848194","taxPayerName":"刘松","taxPayerIdentificationCode":"510124199203020819","calc_Tax_Flag":"2","ciPlatQueryOutCurentTax":{"taxConditionCode":"N","taxLocationCode":"510000","taxStartDate":"20230101","taxEndDate":"20231231","unitRate":"0.0","annualTaxAmount":"0.0","taxDue":"0.0","exceedDaysCount":"0","overDue":"0.0","totalAmount":"0.0","ciPlatQueryOutPaid":{},"ciPlatQueryOutDerate":{"deductionDocumentNumber":"251888电动车","taxDepartment":"国家税务总局四川省税务局"}},"ciPlatQueryOutTaxAmount":{"taxAmount_Flag":"1","annualTaxDue":"0.0","sumTaxDefault":"0.0","sumOverdue":"0.0","sumTax":"0.0"}},"ciPlatQueryOutRate":{"shortRate":"1.0000"},"tipMessage":"成功"}},"riskTruckFlag":"0","onlineCarFlag":"0","tSign":"0"}]}}}';
        //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-23 16:32:33","processId":"40bbdde94fe7e60e","result":{"data":{"records":[{"calculateNo":"Q0515251018323000288","premiumBi":{"quoteorderserialno":"Q0515251018323000288","claimAdjustValue":"0.5","discount":"0.6750","peccancyAdjustValue":"1.0","shortRate":"100.0000","sumAmount":"4666533.40","sumBenchmarkPremium":"7860.67","sumDisountPremium":"2368.25","sumPremium":"4918.67","sumsubpremium":"1416.83","ilogfeetypebi":"Y1","ilogbusinesstypebi":"999","deductionpremium":"-387.32","insureYears":"4","claimTimes":"0","claimAdjustLevel":"-4"},"premiumKinds":[{"quoteorderserialno":"Q0515251018323000288","basePremium":"3474.49","benchMarkPremium":"4087.63","itemkindNo":"1","kindCode":"A","premium":"2759.15","rate":"0.0000","deductionbenchmarkpremium":"-408.76","deductionpremium":"-275.92","deductiondiscount":"0.00","deductiblerate":"-0.1","amount":"216533.40"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"837.41","benchMarkPremium":"985.19","itemkindNo":"6","kindCode":"B","premium":"665.00","rate":"0.0000","deductionbenchmarkpremium":"-147.78","deductionpremium":"-99.75","deductiondiscount":"0.00","deductiblerate":"-0.15"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"66.99","benchMarkPremium":"78.81","itemkindNo":"7","kindCode":"B2","premium":"53.20","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"44.25","benchMarkPremium":"52.06","itemkindNo":"16","kindCode":"C1","premium":"35.14","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"53.10","benchMarkPremium":"62.47","itemkindNo":"17","kindCode":"C2","premium":"42.17","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"20.18","benchMarkPremium":"23.74","itemkindNo":"10","kindCode":"D3","premium":"16.03","rate":"0.2018","deductionbenchmarkpremium":"-3.56","deductionpremium":"-2.40","deductiondiscount":"0.00","deductiblerate":"-0.15"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"77.64","benchMarkPremium":"91.34","itemkindNo":"13","kindCode":"D4","premium":"61.66","rate":"0.1294","deductionbenchmarkpremium":"-13.70","deductionpremium":"-9.25","deductiondiscount":"0.00","deductiblerate":"-0.15"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"69.74","benchMarkPremium":"82.04","itemkindNo":"9","kindCode":"H3_B","premium":"55.38","rate":"100.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"11.55","benchMarkPremium":"13.58","itemkindNo":"12","kindCode":"H3_D3","premium":"9.17","rate":"100.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"41.56","benchMarkPremium":"48.90","itemkindNo":"15","kindCode":"H3_D4","premium":"33.01","rate":"100.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"-487.73","benchMarkPremium":"-573.80","itemkindNo":"18","kindCode":"K","premium":"-387.32","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"1494.09","benchMarkPremium":"1757.75","itemkindNo":"2","kindCode":"L","premium":"1186.48","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"98.09","benchMarkPremium":"115.40","itemkindNo":"5","kindCode":"P1","premium":"77.90","rate":"0.0453","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"62.00","benchMarkPremium":"72.94","itemkindNo":"8","kindCode":"R_B","premium":"49.24","rate":"0.6200","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"62.00","benchMarkPremium":"72.94","itemkindNo":"11","kindCode":"R_D3","premium":"49.24","rate":"0.6200","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"62.00","benchMarkPremium":"72.94","itemkindNo":"14","kindCode":"R_D4","premium":"49.24","rate":"0.6200","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"6.50","benchMarkPremium":"7.65","itemkindNo":"3","kindCode":"T","premium":"5.16","rate":"6.5000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0515251018323000288","basePremium":"200.00","benchMarkPremium":"235.29","itemkindNo":"4","kindCode":"X2","premium":"158.82","rate":"2.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"}],"biQueryInfo":{"querySequenceNo":"V0101DBIC510023110200728347549","queryPastDate":"202312031632","renewalFlag":"0","newVehicleFlag":"0"},"nonVehicleSubSidy":{"nonVehicleSubsidy":"0.0","nonVehicleSubsidyFlag":"1","billCORilog":"0.9","billCORilogFlag":"0","businesstype":"null","strategyAdj":"1"},"main":{"priceId":"182023112316322919562734707","requestId":"Q0515251018323000288","certiNo":"182023112316322919562734707","tradeType":"T","isPrice":"1","commissionFlag":"COMMISSIONFLAG","uwPolicyType":"2","uwdiscfixed":"0.0","uwDiscLimit":"0.0","uwDiscFloor":"0.5","comCostPrem":"4349.81","ctpCostPrem":"899.77","ctpCostPremFlag":"3","entireRecommenDiscount":"0.675","entireUwritingDiscount":"0.675","entireRawInitialDiscount":"0.675","entireInitialDiscount":"0.675","entireExpDiscount":"0.0","entireFloatDiscount":"0.0","entireDiscount":"0.675","billComCommission":"0.0","billComCor":"0.9289","billCtpCor":"0.0","billCommission":"0.0","billCor":"0.9289","billCtpelr":"1.2212","billComelr":"0.9289","billElr":"0.9687","sunlightScore":"76.0","comSunlightScore":"0.0","ctpSunlightScore":"0.0","strategyAdj":"1.0","entireFitDiscAdj":"0.675","entireFitDiscAdj2":"0.675","entireControlIntialDiscount":"0.675","recommenELR":"0.9687","initialELR":"0.9687","billCTPELR2":"1.2212","billCOMELR2":"0.9289","billELR2":"0.9687","ncdbpremELR":"1.2483"},"underWritingFactors":[{"factorCode":"C20","factorFlag":"2","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"2","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"2","factorName":"自主定价系数","factorValue":"1.35"}],"initialFactors":[{"factorCode":"C20","factorFlag":"3","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"3","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"3","factorName":"自主定价系数","factorValue":"1.35"}],"signBillFactors":[{"factorCode":"C20","factorFlag":"6","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"6","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"6","factorName":"自主定价系数","factorValue":"1.35"},{"factorCode":"C01","factorFlag":"6","factorName":"指定驾驶人","factorValue":"1.0"},{"factorCode":"C24","factorFlag":"6","factorName":"平均年行驶里程","factorValue":"1.0"},{"factorCode":"C23","factorFlag":"6","factorName":"多险别投保","factorValue":"0.95"},{"factorCode":"C33","factorFlag":"6","factorName":"客户风险等级","factorValue":"1.3534"},{"factorCode":"C04","factorFlag":"6","factorName":"行驶区域","factorValue":"1.05"}],"rules":[{"ruleCode":"新-004","ruleType":"2"}],"carModels":[{"modelCode":"BBYDTAUD0030","modelIDCode":"BBYDTAUD003020A1","tradeName":"比亚迪汽车有限公司","tradeCode":"M0080","brand":"比亚迪","brandCode":"BYD","series":"唐","seriesCode":"BYDTA","carName":"比亚迪BYD6490SBEV 智联创领型 5座","noticeType":"BYD6490SBEV","configType":"UD","categoryName":"越野汽车","categoryCode":"2","deptName":"国产","deptCode":"0"}],"modelPrices":[{"modelCode":"BBYDTAUD0030","noticeType":"BYD6490SBEV"}],"reInsureItem":{"vin":"LC0CF4CD7K1011288","engineNo":"119000650","insurerCompanyType":"2"},"LastPolicy":{"lastEffectiveDate":"202304060000","lastExpireDate":"202404060000","lastProducerCode":"52","isLocalPolicy":"1"},"precisionScores":[{"scoreCode":"01","score":"70","updateTime":"20230331"}],"biPlatQuery":{"outHead":{"requestType":"173","responseCode":"1","errorCode":"000000","errorMessage":"成功","logId":"1956273406"},"body":{"basePartOutDto":{"querySequenceNo":"V0101DBIC510023110200728347549","queryPastDate":"202312031632","renewalFlag":"0","newVehicleFlag":"0"},"lastPolicyOutDto":{"lastEffectiveDate":"202304060000","lastExpireDate":"202404060000","lastProducerCode":"52","isLocalPolicy":"1"},"carModelOutDtos":[{"modelCode":"BBYDTAUD0030","modelIDCode":"BBYDTAUD003020A1","tradeName":"比亚迪汽车有限公司","tradeCode":"M0080","brand":"比亚迪","brandCode":"BYD","series":"唐","seriesCode":"BYDTA","carName":"比亚迪BYD6490SBEV 智联创领型 5座","noticeType":"BYD6490SBEV","configType":"UD","categoryName":"越野汽车","categoryCode":"2","deptName":"国产","deptCode":"0"}],"riskItemOutDto":{"claimAdjustValue":"-0.5","peccancyAdjustValue":"0.0","insureYears":"4","claimTimes":"0","claimAdjustLevel":"-4"},"coveragePremiumItemOutDto":{"coverageCode":"0401200","pureRiskPremiumItemOutDtos":[{"modelCode":"BBYDTAUD0030","pureRiskPremium":"3474.488220","pureRiskPremiumFlag":"1"}]},"precisionScoreOutDto":{"scoreCode":"01","score":"70","updateTime":"20230331"},"tipsMessage":{"reInsureItem":{"vin":"LC0CF4CD7K1011288","engineNo":"119000650","insurerCompanyType":"2"}}}},"chargingSubs":[{"itemKindNo":"1","kindCode":"C1","rate":"0.4425","basePremium":"44.25","benchmarkPremium":"52.06","premium":"35.14"},{"itemKindNo":"1","kindCode":"C2","rate":"0.1770","basePremium":"53.10","benchmarkPremium":"62.47","premium":"42.17"}],"riskTruckFlag":"0","onlineCarFlag":"0","tSign":"0"}]}}}';
        $testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2024-03-25 16:50:52","processId":"2508f5072dd9222d","result":{"data":{"records":[{"calculateNo":"Q0510251018324044300","useYears":11,"premiumBi":{"quoteorderserialno":"Q0510251018324044300","claimAdjustValue":"0.5","discount":"0.4750","peccancyAdjustValue":"1.0","shortRate":"100.0000","sumAmount":"2150000.00","sumBenchmarkPremium":"999.42","sumDisountPremium":"524.70","sumPremium":"474.73","sumsubpremium":"31.67","ilogfeetypebi":"Y1","ilogbusinesstypebi":"HXYJS","deductionpremium":"0.00","insureYears":"4","claimTimes":"0","claimAdjustLevel":"-4"},"premiumCi":{"quoteorderserialno":"Q0510251018324044300","basedPremium":"950.0","claimAdjustReason":"E3","claimAdjustValue":"0.7","discount":"0.70","lasBillDate":"20230318","lastEndDate":"202404051700","lastStartDate":"202304051700","peccancyAdjustValue":"1.0","reinsureFlag":"0","shortRate":"100.0000","standardPremium":"665.0","sumAmount":"200000.00","sumDisountPremium":"199.50","sumsubpremium":"0.00","ilogfeetypeci":"Y1","ilogbusinesstypeci":"HXYJS"},"premiumHi":{"quoteorderserialno":"Q0510251018324044300","subpolicyno":"9307632425101820000741","channelcode":"4Q","trialpremium":"150","uuid":"20240325165042390757827414719173"},"carShipTax":{"quoteorderserialno":"Q0510251018324044300","annualTaxDue":"360.0","sumOverrdue":"0.0","sumTax":"360.0","sumTaxDefault":"0.0","taxEndDate":"20241231","taxPayerIdentificationCode":"513124198301245120","taxPayerName":"周小琴","taxRegistryNumber":"510105795848194","taxRelifFlag":"T","taxStartDate":"20240101","unitRate":"360.0"},"premiumKinds":[{"quoteorderserialno":"Q0510251018324044300","basePremium":"624.50","benchMarkPremium":"832.67","itemkindNo":"1","kindCode":"B","premium":"395.52","rate":"0.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0510251018324044300","basePremium":"21.22","benchMarkPremium":"28.29","itemkindNo":"3","kindCode":"D3","premium":"13.44","rate":"0.2122","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0510251018324044300","basePremium":"53.84","benchMarkPremium":"71.79","itemkindNo":"4","kindCode":"D4","premium":"34.10","rate":"0.1346","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"},{"quoteorderserialno":"Q0510251018324044300","basePremium":"50.00","benchMarkPremium":"66.67","itemkindNo":"2","kindCode":"H3_B","premium":"31.67","rate":"100.0000","deductionbenchmarkpremium":"0","deductionpremium":"0","deductiondiscount":"0.00","deductiblerate":"0"}],"biQueryInfo":{"querySequenceNo":"V0101DBIC510024030271356632570","queryPastDate":"202404041650","renewalFlag":"0","newVehicleFlag":"0","isRedis":"1"},"ciQueryInfo":{"querySequenceNo":"01DBIC510024030271356641901644","renewalFlag":"0","isNewCarFlag":"0"},"nonVehicleSubSidy":{"nonVehicleSubsidy":"28.868","nonVehicleSubsidyFlag":"1","billCORilog":"0.9","billCORilogFlag":"0","businesstype":"null","strategyAdj":"1"},"main":{"priceId":"1820240325165052558355334","requestId":"Q0510251018324044300","certiNo":"1820240325165052558355334","tradeType":"T","isPrice":"1","commissionFlag":"COMMISSIONFLAG","uwPolicyType":"2","uwdiscfixed":"0.0","uwDiscLimit":"0.0","uwDiscFloor":"0.475","comCostPrem":"234.58","ctpCostPrem":"278.78","ctpCostPremFlag":"2","entireRecommenDiscount":"0.25","entireUwritingDiscount":"0.475","entireRawInitialDiscount":"0.475","entireInitialDiscount":"0.475","entireExpDiscount":"0.0","entireFloatDiscount":"0.0","entireDiscount":"0.475","billComCommission":"0.31","billComCor":"0.8338","billCtpCor":"0.7494","billCommission":"0.3071","billCor":"0.7846","billCtpelr":"0.4444","billComelr":"0.5238","billElr":"0.4775","sunlightScore":"6.0","comSunlightScore":"0.0","ctpSunlightScore":"0.0","strategyAdj":"1.0","entireFitDiscAdj":"0.25","entireFitDiscAdj2":"0.25","entireControlIntialDiscount":"0.475","recommenELR":"0.5948","initialELR":"0.4775","billCTPELR2":"0.4444","billCOMELR2":"0.4593","billELR2":"0.4506","ncdbpremELR":"0.4672"},"underWritingFactors":[{"factorCode":"C20","factorFlag":"2","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"2","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"2","factorName":"自主定价系数","factorValue":"0.95"}],"initialFactors":[{"factorCode":"C20","factorFlag":"3","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"3","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"3","factorName":"自主定价系数","factorValue":"0.95"}],"signBillFactors":[{"factorCode":"C20","factorFlag":"6","factorName":"无赔款优待系数","factorValue":"0.5"},{"factorCode":"C17","factorFlag":"6","factorName":"交通违法系数","factorValue":"1.0"},{"factorCode":"CCC","factorFlag":"6","factorName":"自主定价系数","factorValue":"0.95"},{"factorCode":"C01","factorFlag":"6","factorName":"指定驾驶人","factorValue":"1.0"},{"factorCode":"C24","factorFlag":"6","factorName":"平均年行驶里程","factorValue":"1.0"},{"factorCode":"C33","factorFlag":"6","factorName":"客户风险等级","factorValue":"0.9048"},{"factorCode":"C04","factorFlag":"6","factorName":"行驶区域","factorValue":"1.05"}],"rules":[{"ruleCode":"055","ruleType":"2"}],"carModels":[{"modelCode":"BHCEWYUC0013","modelIDCode":"BHCEWYUC001371A1","tradeName":"华晨宝马汽车有限公司","tradeCode":"M0369","brand":"华晨宝马","brandCode":"HCE","series":"华晨宝马5系","seriesCode":"HCEWY","carName":"宝马BMW7201GL(BMW520Li) 典雅型","noticeType":"BMW7201GL(BMW520Li)","configType":"UC","categoryName":"轿车","categoryCode":"7","deptName":"合资","deptCode":"1"}],"modelPrices":[{"modelCode":"BHCEWYUC0013","noticeType":"BMW7201GL(BMW520Li)"}],"reInsureItem":{"policyNo":"2077103562023001263","insurerCode":"DJPC","coverageItems":[{"coverageCode":"0301600"},{"coverageCode":"0301701"},{"coverageCode":"0301702"}],"licensePlateNo":"川TJF027","licensePlateType":"02","vin":"LBVCU1101DSG42470","engineNo":"A8710324","effectiveDate":"202304060000","expireDate":"202404060000","billDate":"20230318","insurerArea":"510000"},"LastPolicy":{"lastEffectiveDate":"202304060000","lastExpireDate":"202404060000","lastProducerCode":"54","isLocalPolicy":"1"},"precisionScores":[{"scoreCode":"01","score":"56","updateTime":"20230930"}],"biPlatQuery":{"outHead":{"requestType":"173","responseCode":"1","errorCode":"000000","errorMessage":"成功","logId":"55834777"},"body":{"basePartOutDto":{"querySequenceNo":"V0101DBIC510024030271356632570","queryPastDate":"202404041650","renewalFlag":"0","newVehicleFlag":"0","isRedis":"1"},"lastPolicyOutDto":{"lastEffectiveDate":"202304060000","lastExpireDate":"202404060000","lastProducerCode":"54","isLocalPolicy":"1"},"carModelOutDtos":[{"modelCode":"BHCEWYUC0013","modelIDCode":"BHCEWYUC001371A1","tradeName":"华晨宝马汽车有限公司","tradeCode":"M0369","brand":"华晨宝马","brandCode":"HCE","series":"华晨宝马5系","seriesCode":"HCEWY","carName":"宝马BMW7201GL(BMW520Li) 典雅型","noticeType":"BMW7201GL(BMW520Li)","configType":"UC","categoryName":"轿车","categoryCode":"7","deptName":"合资","deptCode":"1"}],"riskItemOutDto":{"claimAdjustValue":"-0.5","peccancyAdjustValue":"0.0","insureYears":"4","claimTimes":"0","claimAdjustLevel":"-4"},"precisionScoreOutDto":{"scoreCode":"01","score":"56","updateTime":"20230930"},"tipsMessage":{"reInsureItem":{"policyNo":"2077103562023001263","insurerCode":"DJPC","coverageItems":[{"coverageCode":"0301600"},{"coverageCode":"0301701"},{"coverageCode":"0301702"}],"licensePlateNo":"川TJF027","licensePlateType":"02","vin":"LBVCU1101DSG42470","engineNo":"A8710324","effectiveDate":"202304060000","expireDate":"202404060000","billDate":"20230318","insurerArea":"510000"}}}},"ciPlatQuery":{"outHead":{"requestType":"013","responseCode":"1","errorCode":"000000","errorMessage":"成功","logId":"55834792"},"ciPlatQueryOutBody":{"basePart":{"querySequenceNo":"01DBIC510024030271356641901644","renewalFlag":"0","isNewCarFlag":"0"},"coverages":[{"coverageType":"1","coverageCode":"BZ","standardPremium":"665.0","peccancyAdjustValue":"0.0","claimAdjustValue":"-0.3","basedPremium":"950.0","claimAdjustReason":"E3","reinsureFlag":"0","lastBillDate":"20230318","lastStartDate":"202304051700","lastEndDate":"202404051700"}],"carshipTax":{"taxTermTypeCode":"08","taxConditionCode":"T","taxRegistryNumber":"510105795848194","taxPayerName":"周小琴","taxPayerIdentificationCode":"513124198301245120","declare_Status_IA":"0","calc_Tax_Flag":"2","ciPlatQueryOutCurentTax":{"taxConditionCode":"T","taxLocationCode":"510000","taxStartDate":"20240101","taxEndDate":"20241231","taxUnitTypeCode":"1","unitRate":"360.0","annualTaxAmount":"360.0","taxDue":"360.0","exceedDaysCount":"0","overDue":"0.0","totalAmount":"360.0","ciPlatQueryOutPaid":{},"ciPlatQueryOutDerate":{}},"ciPlatQueryOutTaxAmount":{"taxAmount_Flag":"1","annualTaxDue":"360.0","sumTaxDefault":"0.0","sumOverdue":"0.0","sumTax":"360.0"}},"ciPlatQueryOutRate":{"shortRate":"1.0000"},"tipMessage":"成功"}},"riskTruckFlag":"0","onlineCarFlag":"0","tSign":"0"}]}}}';
        $response = $IDock->premiumInquiry($shortName, $premiumInquiryVisitor);

        /*** @var $printer PremiumInquiryPrinter; */
        $printer = $response->getPrinter();

        if (!$response->isSuccess()) {
            var_dump($response->getError());
            var_dump($printer->repeatInsurePrinter);
        } else {
            var_dump($printer->toArray());
            //var_dump($response->getPrinter()->toArray());
            var_dump($printer->inquiryNo);
            var_dump($printer->argc['calculateNo']);
            var_dump('VCI:--' . $printer->biInquiryNo);
            var_dump('TCI:--' . $printer->ciInquiryNo);
        }

        exit();
    }

    //核保
    if (1) {
        //影像资料上传
        //$premiumInquiryVisitor->fileAppend('10010', 'https://p0.itc.cn/q_70/images03/20220512/77ed76720a1f40ef94948761dda05655.jpeg');

        /**
         * 核保信息
         */
        $premiumUnderwritingVisitor = new PremiumUnderwritingVisitor();
        $premiumInquiryVisitor->getExtInfoVisitor()->argc['calculateNo'] = 'Q0510251010023000608';
        $premiumUnderwritingVisitor->inquiryNo = '';
        $premiumUnderwritingVisitor->biInquiryNo = 'V0101DBIC510023110289931186059';
        $premiumUnderwritingVisitor->ciInquiryNo = '01DBIC510023110999931186917935';

        $specialClauses = new SpecialClausesVisitor();
        $specialClauses->clauseCode = 'T0048';
        $specialClauses->clauseName = '非营业车辆特别约定';
        $specialClauses->clauseContent = '非营业车辆因从事营业性运输而导致的事故，我公司不承担赔偿责任.';
        $specialClauses->clauseType  = '0';
        $specialClauses->riskType = 'VCI';
        $specialClauses->autoFlag = '1';
        //
        $specialClauses2 = new SpecialClausesVisitor();
        $specialClauses2->clauseCode = 'T0098';
        $specialClauses2->clauseName = '偿付能力信息披露';
        $specialClauses2->clauseContent = '都邦财产保险股份有限公司2019年3季度核心偿付能力充足率为197%,综合偿付能力充足率为197%,最近一季度风险综合评级为B。根据中国保险监督管理委员偿付能力监管规则规定，公司偿付能力充足率满足监管要求。';
        $specialClauses2->clauseType  = '0';
        $specialClauses2->riskType = 'VCI';
        $specialClauses2->autoFlag = '0';

        $specialClauses3 = new SpecialClausesVisitor();
        $specialClauses3->clauseCode = 'T0098';
        $specialClauses3->clauseName = '偿付能力信息披露';
        $specialClauses3->clauseContent = '都邦财产保险股份有限公司2019年3季度核心偿付能力充足率为197%,综合偿付能力充足率为197%,最近一季度风险综合评级为B。根据中国保险监督管理委员偿付能力监管规则规定，公司偿付能力充足率满足监管要求。';
        $specialClauses3->clauseType  = '0';
        $specialClauses3->riskType = 'TCI';
        $specialClauses3->autoFlag = '0';

        $premiumUnderwritingVisitor->specialClausesAppend($specialClauses);
        $premiumUnderwritingVisitor->specialClausesAppend($specialClauses2);
        $premiumUnderwritingVisitor->specialClausesAppend($specialClauses3);
        //
        //
        $premiumInquiryVisitor->setUnderwritingVisitor($premiumUnderwritingVisitor);

        //$testResponse = '';

        //核保
        $response = $IDock->underwriting($shortName, $premiumInquiryVisitor);

        if ($response->isSuccess()) {
            /*** @var $printer PremiumUnderwritingPrinter; */
            $printer = $response->getPrinter();
            var_dump($printer->inquiryNo);
            var_dump($printer->ciPolicyNo);
            var_dump($printer->biPolicyNo);
            var_dump($printer->toArray());
        } else {
            var_dump($response->getError());
        }

        exit;
    }
}

$inquiryNo = 'EI000000202407908410';
//投保单状态查询
if (0) {
    $proposalStatusVisitor = new ProposalStatusVisitor();

    $proposalStatusVisitor->inquiryNo = $inquiryNo;
    $proposalStatusVisitor->biInquiryNo = '';
    $proposalStatusVisitor->ciInquiryNo = '10590251018324000246';

    $testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2024-01-03 14:00:15","processId":"f5874163e63220b1","result":{"data":{"records":[{"quoteOrderNo":"EI000000202407908410","proposalNo":"10590251018324000246","policyNo":"20590251018324000103","status":"4","inputSysCode":"B2"}]}}}';

    $response = $IDock->proposalStatus($shortName, $proposalStatusVisitor);

    var_dump($response->isSuccess());
    var_dump($response->getError());

    /*** @var $printer ProposalStatusPrinter */
    $printer = $response->getPrinter();

    var_dump($printer);
    exit;
}

//投保单撤回
if (0) {
    //$inquiryNo = 'E2510100202300000004';

    $proposalRecallVisitor = new ProposalRecallVisitor();

    $proposalRecallVisitor->inquiryNo = $inquiryNo;
    $proposalRecallVisitor->biInquiryNo = '';
    $proposalRecallVisitor->ciInquiryNo = '';
    $proposalRecallVisitor->reason = '';

    $testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-13 10:30:25","processId":"a25f65a1fccaeba6","result":{"data":{"records":[{"opsResult":true}]}}}';

    $response = $IDock->proposalRecall($shortName, $proposalRecallVisitor);

    var_dump($response->isSuccess());
    var_dump($response->getError());

    /*** @var $printer ProposalRecallPrinter */
    $printer = $response->getPrinter();
    var_dump($printer->toArray());
    exit;
}

//支付
if (0) {
    $policyPaymentVisitor = new PolicyPaymentVisitor();
    $policyPaymentVisitor->inquiryNo = $inquiryNo;
    $policyPaymentVisitor->ciInquiryNo = '10590251010023000087';
    $policyPaymentVisitor->biPolicyNo = '';
    $policyPaymentVisitor->ciPolicyNo = '';

    $policyPaymentVisitor->argc['MCHID'] = '00032';
    $policyPaymentVisitor->argc['OUTORDERNO'] = date('Ymd') . rand(1000, 9999);
    $policyPaymentVisitor->argc['TOTALFEE'] = (6134.44 + 950.0 + 360.0);
    $policyPaymentVisitor->argc['BACKCALLURL'] = 'https://a.bxt.freeradio.cn/insuranceDockAsy/DBICPayment';
    $policyPaymentVisitor->argc['GOODDIRECTION'] = 'B2';
    $policyPaymentVisitor->argc['ciPremium'] = '1310';
    $policyPaymentVisitor->argc['biPremium'] = '6134.44';

    $testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2024-01-04 17:40:05","processId":"8c6190acaa84b2db","result":{"data":{"records":[{"ORDERNO":"1000322024010417400477405","OUTORDERNO":"EI000000202407940135","NONCESTR":"1LVkf92024010417400583047","TOTALFEE":"107000","JUMPURL":"https://s.dbic.com.cn/dbic/pay/translate/authProposalTmp/4068bdc6-6972-4e2a-b00b-0899cce01a34","QRCODE":"iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAD+0lEQVR42u3bUXLCMAwFQO5/6fYK\npdKT5WTfZ4cmIC8zsmI+PyKBfJRAwBKwBCwRsAQsAUsELAFLwBIBS8ASsETAErAELBGwBCwBSwQs\nAUvAEgFLwBKwRBbB+gTyl3sl3v+3r0l8lsq9uuoMFlhggQUWWGDtgpW4zl+K8m0RT+H+FtNkncEC\nCyywwAILrDtgVRa7slE41fhXGuRKfRJ1BgsssMACCyywng/rVNHT/5uuD1hggQUWWGCBBdZ/PnD6\nOpV7TQ5RwQILLLDAAgusd8GaLGjXMDMxdK0MfifrDBZYYIEFFlhg7YV1ajD4tr8n6gyWv4MFFlhg\ngbUL1rZUHmYnmv3J4erhyoMFFlhggQUWWEua98nrVN5/F4iuAexOrGCBBRZYYIEF1nTj3PUh0//b\nNVQ8tcDzQ1GwwAILLLDAAmu6eU+j6Tqgt+G+iQ3Eo35MARZYYIEFFlgvhJVevERT3PUFOPV+uiCC\nBRZYYIEFFlj3Ne+3DCRPPTivXHMnMrDAAgsssMACazqJB6KTh926FjXxZZisOVhggQUWWGCBdUfz\nnihoekBaGZYmXpNADxZYYIEFFlhg7Wreu4qYGACmD+WlMaU3DWCBBRZYYIEF1jMHpJWFTDS56cHm\nhqYeLLDAAgsssMC6u3mvDEtnHqD2vofJB8x7aggWWGCBBRZYYJ1cgA0PWbsO/aUHtpNNPVhggQUW\nWGCBdQes9MJ3DU67mvF0w55YL7DAAgsssMAC6w5Yp4Z+iYNyXfi67jt5GBAssMACCyywwDoPqwtB\nGnp6KNr1uRKHDa8/3QAWWGCBBRZYL4Q1uWDpwWZ6kJv4Er56VwgWWGCBBRZYL5xjJVCmh6KV6yQa\n7W2HHMECCyywwAILrPPNe1dj3vX69EYkvTlI1xkssMACCyywwHoOrK5FmtwoTA5OE7iDWzGwwAIL\nLLDAAmsY1qnhZ2KwmR6ETgYssMACCyywwLoPVgLfqeY0MYxN1HnyOmCBBRZYYIEF1t7mPfGQdTOU\nZzTpYIEFFlhggQXWBKz42w0MWicXO70RmQcEFlhggQUWWGBNN++JxUj8GCH9o4nEpmfyATxYYIEF\nFlhggbV3QJq4TlcRNzzQTRyQTHwBwAILLLDAAgusXbAqTXrXwLOyyUgszIYfVlw5IAULLLDAAgss\nsKKwEg14YqOQaMwNSMECCyywwAILrOnmPd3gdw1IuxrtxAYFLLDAAgsssMC6A1b6oWzXob/NCCaH\ntGCBBRZYYIEF1l5YiQeliUIn3k/lXqfqDxZYYIEFFlhg7YUlApaAJWCJgCVgCVgiYAlYApaAJQKW\ngCVgiYAlYAlYImAJWAKWCFgCloAlApaAJWCJNOQX/irAwI7Eru8AAAAASUVORK5CYII="}]}}}';

    $response = $IDock->policyPayment($shortName, $policyPaymentVisitor);

    var_dump($response->isSuccess());
    if ($response->isSuccess()) {
        /*** @var $printer PolicyPaymentPrinter */
        $printer = $response->getPrinter();

        var_dump($printer->toArray());
    } else {
        var_dump($response->getError());
    }

    exit;
}

//电子保单下载
if (0) {
    $testResponse = '{"responseCode":"0","responseMsg":"失败","errorCode":"mspls0210002","errorMsg":"保单未生效不能下载电子保单！","responseTime":"2024-01-03 16:23:37","processId":"b300464a5267f3c6","result":{"data":{"records":[{"info":"请联系管理员"}]}}}';
    $EPolicyDownloadVisitor = new EPolicyDownloadVisitor();

    $EPolicyDownloadVisitor->policyNo = '20590251018324000121';

    $response = $IDock->EPolicyDownload($shortName, $EPolicyDownloadVisitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        /*** @var $printer EPolicyDownloadPrinter */
        $printer = $response->getPrinter();
        var_dump($printer);
    }
    exit;
}

//非车产品代码
if (0) {
//    $testResponse = '{"responseCode":"0","responseMsg":"失败","errorCode":"mspls0210002","errorMsg":"保单未生效不能下载电子保单！","responseTime":"2024-01-03 16:23:37","processId":"b300464a5267f3c6","result":{"data":{"records":[{"info":"请联系管理员"}]}}}';
    $visitor = new NonCarProductListVisitor();

    $visitor->seats = '5';

    $response = $IDock->nonCarProductList($shortName, $visitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        /*** @var $printer EPolicyDownloadPrinter */
        $printer = $response->getPrinter();
        var_dump($printer);
    }
    exit;
}

